package com.yunshan.mp.service.impl;

import java.util.List;

import com.yunshan.common.annotation.DataScope;
import com.yunshan.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yunshan.mp.mapper.MpServeTypeMapper;
import com.yunshan.mp.domain.MpServeType;
import com.yunshan.mp.service.IMpServeTypeService;

/**
 * 服务类型Service业务层处理
 *
 * @author yunshan
 * @date 2025-02-27
 */
@Service
public class MpServeTypeServiceImpl implements IMpServeTypeService
{
    @Autowired
    private MpServeTypeMapper mpServeTypeMapper;

    /**
     * 查询服务类型
     *
     * @param id 服务类型主键
     * @return 服务类型
     */
    @Override
    public MpServeType selectMpServeTypeById(Long id)
    {
        return mpServeTypeMapper.selectMpServeTypeById(id);
    }

    /**
     * 查询服务类型列表
     *
     * @param mpServeType 服务类型
     * @return 服务类型
     */
    @Override
    @DataScope(deptAlias = "mp_serve_type")
    public List<MpServeType> selectMpServeTypeList(MpServeType mpServeType)
    {
        return mpServeTypeMapper.selectMpServeTypeList(mpServeType);
    }

    /**
     * 新增服务类型
     *
     * @param mpServeType 服务类型
     * @return 结果
     */
    @Override
    public int insertMpServeType(MpServeType mpServeType)
    {
        mpServeType.setCreateTime(DateUtils.getNowDate());
        return mpServeTypeMapper.insertMpServeType(mpServeType);
    }

    /**
     * 修改服务类型
     *
     * @param mpServeType 服务类型
     * @return 结果
     */
    @Override
    public int updateMpServeType(MpServeType mpServeType)
    {
        mpServeType.setUpdateTime(DateUtils.getNowDate());
        return mpServeTypeMapper.updateMpServeType(mpServeType);
    }

    /**
     * 批量删除服务类型
     *
     * @param ids 需要删除的服务类型主键
     * @return 结果
     */
    @Override
    public int deleteMpServeTypeByIds(Long[] ids)
    {
        return mpServeTypeMapper.deleteMpServeTypeByIds(ids);
    }

    /**
     * 删除服务类型信息
     *
     * @param id 服务类型主键
     * @return 结果
     */
    @Override
    public int deleteMpServeTypeById(Long id)
    {
        return mpServeTypeMapper.deleteMpServeTypeById(id);
    }

    @Override
    public MpServeType selectMpServeTypeByDeptId(Long deptId) {
        return mpServeTypeMapper.selectMpServeTypeByDeptId(deptId);
    }
}
